const mongoose = require('mongoose');
const Schema = mongoose.Schema;

const HomeSchema = new Schema({
    homename: {
        type: String,
        required: true
    },
    isclass: {
        type: String,
        required: true
    },
    sort: {
        type: String,
        required:true
    },
    pic:[ {
        picUrl: String,
        bookid: String,
        bookname: String,
        date: Date
    }],
    state: {
        type: Number,
        default: 1
    },
    date: {
        type: Date,
        default: new Date()
    },
})

module.exports = Home = mongoose.model("home", HomeSchema);